Repository navigation
fix(console): the skill download teaches delete_record confirm: true and mirrors the served SKILL.md - #31015
Merged
Conversation
…and mirrors the served SKILL.md The Console's SKILL.md mirror had drifted from renderSkillMarkdown: it taught delete_record without confirm (now refused with ACTION_CONFIRMATION_REQUIRED) and lacked list_actions, run_action, resume_run, validate_expression and the OAuth track. The mirror now renders the canonical default-scope text, and its test imports the canonical renderer from source and compares byte for byte. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwpdnaEYjR2FGdUuxD
Contributor
Author
|
domain:ui#2 · os-tesla · session_01L9qibw7DekEe3wx5f3zphf 席位核对 · ACCEPT · 2026-11-06T17:59Z · head
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Tesla · project thread
Fixes #30865
Clause-②: no
Metadata-protocol: none
维护者速读
delete_record带上confirm: true及拒收说明,并补上list_actions/run_action/resume_run/validate_expression和 OAuth 接入方式。confirm: true的删除(ACTION_CONFIRMATION_REQUIRED),照旧下载件操作的 AI 代理每次删除都会失败;下载件还漏教了业务动作工具。ui/apps/console/src/pages/developer/objectstack-skill.test.ts(新的漂移钉:从源码导入服务端渲染函数逐字比对)、objectstack-skill.ts的 Tools 段、changeset。pnpm --dir ui exec vitest run apps/console/src/pages/developer/objectstack-skill.test.ts,预期 13 个测试全绿。828224c8的 diff 复核:3 个文件、+158 / −29,无受治理路径。控制台「下载技能」的 SKILL.md 改为与 MCP 服务端renderSkillMarkdown无 OAuth 范围时的文本逐字节一致(delete_record带confirm: true及确认规则、补齐validate_expression、list_actions/run_action/resume_run、OAuth 连接与 Bearer 密钥写法);测试在 node 环境按相对路径从源码导入服务端渲染器,五种参数逐字节比对,另钉住 11 个工具的顺序与删除调用形状,消融两侧各红。只改packages/mcp/src/skill-md.ts的 PR 不会触发这条比对(CI 过滤器缺口),已立卡 CI: a pull request that edits only the MCP server's SKILL.md renderer skips the Console test that pins its download mirror #31017。Clause-② no,不欠契约复审。同意落地。What changes
ui/apps/console/src/pages/developer/objectstack-skill.ts: the mirror now renders exactly whatrenderSkillMarkdown(packages/mcp/src/skill-md.ts) serves to a caller with no OAuth scopes (an API key or a session), which is the data skill with no authoring section and no federation tools. It gainsOBJECTSTACK_MCP_SERVER_NAMEfor theclaude mcp addsnippet. The header says what it mirrors and which test holds it.objectstack-skill.test.ts: a drift pin. The test runs in the node environment, importsrenderSkillMarkdownand the identity constants from source by relative path (the console does not depend on@objectstack/mcp, which is not browser-safe), and asserts byte equality for five option shapes (none, URL, env name, both padded, blank). Explicit pins sit beside it: the ordered tool list (11 tools) and thedelete_recordcall shape with its confirmation sentence. The old "not Bearer" assertion is replaced by an x-api-key header assertion, because the server now teachesAuthorization: Beareras an accepted key form..changeset/30865-console-skill-download-confirm.md:@object-ui/consolepatch (the package is not private).No mirror text differs from the canonical render on purpose, so the pin is full-text equality rather than the tool-list fallback.
Tests
Measured drift before the fix (mirror vs canonical, same URL and env name, origin/main 8ae0ab9)
diff mirror-before.md canonical.mdwith{ mcpUrl: 'https://acme.objectos.app/api/v1/mcp', envName: 'Acme CRM' }: 85 insertions, 16 deletions, 9 hunks.claude mcp add --transport http objectstack URLexample) and API key; the mirror taught the API key only.Authorization: Bearer KEYtoo; the mirror named onlyApiKey.list_actions.validate_expression.delete_record({ objectName, recordId })with noconfirm; canonical teachesdelete_record({ objectName, recordId, confirm })and theACTION_CONFIRMATION_REQUIREDrefusal. The mirror also lackedlist_actions,run_actionandresume_run.list_actionsin step 1 andrun_actionin step 4.Frontmatter (name, description) was already identical. After the fix: the five equality cases pass, so the diff is empty for every shape tested.
Test run (head 828224c)
pnpm --dir ui exec vitest run apps/console/src/pages/developer/objectstack-skill.test.ts→ Test Files 1 passed (1), Tests 13 passed (13).Ablation (scripts/ablation-replace.mjs, both legs restored to the HEAD blob)
- **delete_record({ objectName, recordId, confirm })** — delete a record,→- **delete_record({ objectName, recordId })** — delete a record,in the mirror (anchor 1 → 0, blob 8612fdae0978 → 7cea2fc32802). Result: 6 failed, 7 passed. Red: "teaches delete_record with confirm: true, which the server requires" and all five "renders the canonical text for …" cases. Restored blob 8612fdae0978 == HEAD.- **Page large reads.** Use→- **Page large reads, always.** Useinpackages/mcp/src/skill-md.ts. Result: 5 failed, 8 passed (the five equality cases). Restored,git diff HEADempty.No build sits between the test and either mutated file: both are imported from source.
Verification
Local gates (derived with dispatch-gates.mjs --commands against this diff)
Head
828224c88f. 35 derived, 35 run, 0 NOT-MEASURED (dispatch-gates.mjs --ranreconciliation exit 0). Every line exit 0:Also
pnpm --dir ui exec vitest run apps/console/src/pages/developer/: Test Files 20 passed (20), Tests 165 passed (165).pnpm --dir ui exec vitest run scripts/: Test Files 170 passed, 2 skipped; Tests 4991 passed, 2 skipped.Console type-check (the relative source import brings packages/mcp/src/skill-md.ts into the console tsc program)
pnpm exec turbo run type-check --concurrency=2 --filter=@object-ui/console→@object-ui/console:type-check: cache miss, executing, Tasks 73 successful, 73 total; lock VERDICT command-exit 0. Alsopnpm --dir ui run check:phantom-deps,check:self-import,check:unreferenced-sources: exit 0 each.Acceptance notes
packages/mcp/src/skill-md.tsmatches neither theuinor theui_consumersfilter inci.yml(packages/mcp/**is not among the sevenui_consumerspackages), so Test UI does not run on that PR or its queue entry; the pin goes red on the nextmainscheduled or dispatched full run instead. Closing it needspackages/mcp/src/skill-md.tsin theuifilter, which is rootci.ymland out of this card's bounds. Carrier: seat.objectstack-skill.ts, its test orpackages/mcp/src/skill-md.ts. feat(i18n)!: the Console's language packs follow the platform locale table, keyed by its tags, and Traditional Chinese (zh-Hant) ships #30902 touches two other test files inui/apps/console/src/pages/developer/(consolePagesLocale-13460.test.tsx,flowRunsClientDiagnostic-25916.test.tsx), with no overlap.